import request from '@/utils/request'

// 查询呈批件列表
export function listApprovalDoc(query) {
  return request({
    url: '/system/batch/list',
    method: 'post',
    params: query
  })
}

// 新增/编辑呈批件
export function addEditApprovalDoc(data) {
  return request({
    url: '/system/batch/add',
    method: 'post',
    data: data
  })
}

// 新增并启动流程的呈批件
export function addApprovalDoc(data) {
  return request({
    url: '/system/batch/applicant',
    method: 'post',
    data: data
  })
}

//呈批件审批
export function handleApprovalDoc(query) {
  return request({
    url: '/system/batch/showVerifyDialog',
    method: 'get',
    params: query
  })
}

// 呈批件详情
export function detailsApprovalDoc(query) {
  return request({
    url: '/system/batch/query',
    method: 'get',
    params: query
  })
}

// 呈批件启动流程
export function startProcessModel(query) {
  return request({
    url: '/system/batch/submitBatch',
    method: 'post',
    params: query
  })
}

// 呈批件流程处理提交
export function submitProcessModel(query) {
  return request({
    url: '/system/batch/complete',
    method: 'get',
    params: query
  })
}

// 呈批件流程承办人处理提交
export function cbrSubmitProcessModel(query) {
  return request({
    url: '/system/batch/undertake',
    method: 'get',
    params: query
  })
}

// 呈批件流程归档处理提交
export function fileSubmitProcessModel(query) {
  return request({
    url: '/system/batch/keepFile',
    method: 'get',
    params: query
  })
}

// 删除呈批件
export function delProcessModel(query) {
  return request({
    url: '/system/batch/remove',
    method: 'post',
    params: query
  })
}

// 导出呈批件
export function exportProcessModel(modelId) {
  return request({
    url: '/system/modeler/export/'+modelId,
    method: 'get',
  })
}

// 打印呈批件
export function printApprovalDoc(query) {
  return request({
    url: '/system/batch/print',
    method: 'get',
    params: query
  })
}
